#!/usr/bin/env python
# _*_ coding: utf-8 _*_
# @Time : 2023/2/11 20:37
# @Author : caoshi
# @Version：V1.0
# @File : 03-基本数据类型.py
# @desc :

# 数字类型
#   整型int   <class 'int'>
age = 73
# print(type(age))

#   浮点型 <class 'float'>
price = 3.5
# print(type(price))


level = 1
# a = level + 1
# print(a)
# print(type(a))

# print(10 - 1)   9
# print(10 * 3)   30
# print(10 / 2)   5.0

# a = 3
# b = 1.5
# c = a + b
# print(c, type(c))     4.5 <class 'float'>

# age = 18
# print(age > 20)
#
# print(age > 16)

# 字符串
'zzz'
"zzz"
# a = """sef"""
# print(a, type(a))

# name = "my name is '张大仙'"
# print(name)

# name2 = 'my name is \'张大仙\''
# print(name2)

# print('张大仙' * 5)

# print('-' * 50)
# print('I love you')
# print('-' * 50)


# name = '张大仙'
# age = 75
# price = 3.5

# 列表
l = [1, 3.5, '篮球', ['aaa', 'bbb'], 1, 3, 'aa', 'bbb', 'ccc']
# print(type(l))  <class 'list'>
# print(l)
# print(l[2])

# print(l[3][1])  bbb

# print(l[-3])    aa

# hobbies = ['张三', '李四', '王五']
# print(hobbies[1])

# 列表嵌套
# person = [
#     ["张大仙", 73, 100, ['可乐', '厕所', '烫头']],
#     ['韩信', 84, 200, ['打仗']],
#     ['李白', 95, 0.5, ['喝酒', '写诗', '练剑']]
# ]

# print(person[1][2])
# print(person[2][3][1])


# 字典类型
dic = {
    "name": "张三",
    "age": 18,
    "height": 180.0
}
# print(type(dic))  <class 'dict'>

# print(dic['name'])
# print(dic['a'])     报错

# person = [
#     {'name': "张大仙", 'age': 73, 'salary': 100, 'hobbies': ['可乐', '厕所', '烫头']},
#     {'name': "韩信", 'age': 84, 'salary': 200, 'hobbies': ['打仗']},
#     {'name': "李白", 'age': 95, 'salary': 230, 'hobbies': ['喝酒', '写诗', '练剑']}
# ]
#
# print(person[1]['name'])
# print(person[2]['hobbies'][2])


# 布尔类型 bool
a = True
b = False
# print(type(a))    <class 'bool'>

c = None
# print(type(c))  <class 'NoneType'>


# 直接引用和间接引用
name = '张大仙'
l = ['a', 'b', name]
# print(l[2]) 张大仙
# print(id(name)) 2765964146704     直接引用
# print(id(l[2])) 2765964146704     间接引用

name = '李白'
# print(l[2])   张大仙





